home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 27 / CU Amiga Magazine's Super CD-ROM 27 (1998)(EMAP Images)(GB)[!][issue 1998-10].iso / GoodBye / JohnKennedy / February96.lha / MASTERCLASS / MASTDEC_DOC.BAK < prev    next >
Encoding:
Text File  |  1996-09-30  |  8.8 KB  |  301 lines

  1. Masterclass
  2.  
  3. Which is the most important file on your Workbench disk? We
  4. reckon it's the Startup-sequence, and here's why.
  5.  
  6.  
  7.  
  8. S Revisted
  9. ----------
  10.  
  11. (ma1.iff)
  12.  
  13. Although we have touched on it before, the S directory is so
  14. important, it's worth taking another look at its contents.
  15. Here is what you will see if you open up the S directory on
  16. a virginal Workbench 3 machine. You'll need to use the
  17. Window menu and pick Show.. All Files to see the contents of
  18. S, because by default the files do not have any icons
  19. attached.
  20.  
  21. Here's the list of what S contains, and a brief explanation
  22. of that the various files do.
  23.  
  24.  
  25. Startup-Sequence
  26.  
  27. Without a doubt, this the most important file of all. When
  28. the Amiga starts to boot up after being switch on, it looks
  29. in the S: directory to see if Startup-sequence is present.
  30. If it is, it loads it and starts executing the list of
  31. AmigaDOS commands it contains. Several very important things
  32. are done by the startup-sequence, including patching any
  33. bugs in the operating systems, setting the keymap used by
  34. the keyboard, creating important directories and copying
  35. files to the RAM disk. Eventually, startup-sequence loads
  36. the Workbench environment.
  37.  
  38. Here's what a typical startup-sequence looks like. I've
  39. added the line numbers -- they aren't present in the file.
  40.  
  41.  
  42. [ 1] ; $VER: startup-sequence 39.9 (9.8.92)
  43. [ 2] 
  44. [ 3] C:SetPatch QUIET
  45. [ 4] C:Version >NIL:
  46. [ 5] C:AddBuffers >NIL: DF0: 15
  47. [ 6] FailAt 21
  48. [ 7] 
  49. [ 8] C:MakeDir RAM:T RAM:Clipboards RAM:ENV RAM:ENV/Sys
  50. [ 9] C:Copy >NIL: ENVARC: RAM:ENV ALL NOREQ
  51. [10] 
  52. [11] Resident >NIL: C:Assign PURE
  53. [12] Resident >NIL: C:Execute PURE
  54. [13] 
  55. [14] Assign >NIL: ENV: RAM:ENV
  56. [15] Assign >NIL: T: RAM:T
  57. [16] Assign >NIL: CLIPS: RAM:Clipboards
  58. [17] Assign >NIL: REXX: S:
  59. [18] Assign >NIL: PRINTERS: DEVS:Printers
  60. [19] Assign >NIL: KEYMAPS: DEVS:Keymaps
  61. [20] Assign >NIL: LOCALE: SYS:Locale
  62. [21] Assign >NIL: LIBS: SYS:Classes ADD
  63. [22] Assign >NIL: HELP: LOCALE:Help DEFER
  64. [23] 
  65. [24] IF NOT EXISTS SYS:Fonts
  66. [25]   Assign FONTS:
  67. [26] EndIF
  68. [27] 
  69. [28] BindDrivers
  70. [29] C:Mount >NIL: DEVS:DOSDrivers/~(#?.info)
  71. [30] 
  72. [31] IF EXISTS DEVS:Monitors
  73. [32]   IF EXISTS DEVS:Monitors/VGAOnly
  74. [33]     DEVS:Monitors/VGAOnly
  75. [34]   EndIF
  76. [35] 
  77. [36]   C:List >NIL: DEVS:Monitors/~(#?.info|VGAOnly) TO T:M LFORMAT "DEVS:Monitors/%s"
  78. [37]   Execute T:M
  79. [38]   C:Delete >NIL: T:M
  80. [39] EndIF
  81. [40] 
  82. [41] SetEnv Workbench $Workbench
  83. [42] SetEnv Kickstart $Kickstart
  84. [43] UnSet Workbench
  85. [44] UnSet Kickstart  
  86. [45] 
  87. [46] C:IPrefs
  88. [47] 
  89. [48] C:ConClip
  90. [49] 
  91. [50] Path >NIL: RAM: C: SYS:Utilities SYS:Rexxc SYS:System S: SYS:Prefs SYS:WBStartup 
  92.        ..SYS:Tools SYS:Tools/Commodities
  93. [51] 
  94. [52] IF EXISTS S:User-Startup
  95. [53]   Execute S:User-Startup
  96. [54] EndIF
  97. [55] 
  98. [56] Resident Execute REMOVE
  99. [57] Resident Assign REMOVE
  100. [58] 
  101. [59] C:LoadWB
  102. [60] EndCLI >NIL:
  103.  
  104.  
  105. Here's an what some of the more important lines are doing in
  106. the startup-sequence.
  107.  
  108. [ 3] Use the SetPatch command to fix any bugs in the
  109. operating system. The Quiet option stops any text from
  110. appearing on screen: this would cause the Shell to be
  111. displayed instead of the blank screen suddenly being
  112. replaced by the Workbench as it pops up.
  113.  
  114. [ 4] Use the Version command display the current Workbench
  115. and Kickstart release. However, the output is not printed on
  116. screen -- it's sent to the dummy device NIL: So, why do it?
  117. Because the command also passes the version into special
  118. variables "Kickstart" and "Workbench"
  119.  
  120. [ 5] This command sets aside some memory to act as a buffer
  121. for the internal floppy disk. This speeds up access. If you
  122. have a reasonable amount of RAM you might want to increase
  123. this number to 25. You can also add buffers to hard drives
  124. and other floppies if you wish: five are always added by
  125. default.
  126.  
  127. [ 6] This makes sure the script won't stop with an error if
  128. something bad happens. The error will be reported, but the
  129. script will carry on to the end.
  130.  
  131. [ 8] Four directories are created in the RAM disk: T,
  132. Clipboards, ENV and Sys.
  133.  
  134. [ 9] The contents of the directory ENVARC (including any
  135. sub-directories) are copied from the boot disk to the ENV
  136. directory in the RAM disk. It's here that many programs
  137. store their preferences and so copying to RAM can speed them
  138. all up quite a lot. It also ensures that any changes made to
  139. them are temporary until the contents are also saved to
  140. ENVARC. The NOREQ keyword stops any requestors from
  141. appearing on screen.
  142.  
  143. [11] Makes the command Assign resident, which means it is
  144. copied into memory to speed things up a little. Notice the
  145. use of the keyword PURE to force the command resident.
  146.  
  147. [12] Makes the command Execute resident.
  148.  
  149. [14] to [26] Makes some important assigns, that is, creates
  150. a new device name (such as REXX:) which points to directory
  151. or device which already exists. It's a way of creating
  152. shortcuts.
  153.  
  154. [28] BindDrivers is hardly used, but when it is it causes
  155. any extra hardware to appear to the Amiga by instigating
  156. it's driver software. So there.
  157.  
  158. [29] This line mounts all the AmigaDOS devices present in
  159. the directory DEVS:DOSDrivers.  This could include CrossDos
  160. devices, CDROM drives or specialist virtual devices such as
  161. PIPE:. Notice how all the files are mounted, except the
  162. icons files (which all end in .info) because of the use of
  163. ~(#?.info) which means "Not any file ending in ".info".
  164.  
  165. [31] to [39] These instructions process the list of monitors
  166. available by creating one large file (stored in T: and
  167. called M), executing it and then deleting it.
  168.  
  169. [41] Creates a variable in ENV: called Workbench, which
  170. contains the value in the variable called Workbench. This
  171. was defined way back in line [4] remember.
  172.  
  173. [42] Creates the Kickstart variable, as above.
  174.  
  175. [43] Deletes the temporary variable Workbench. The variable
  176. in ENV: is still available though.
  177.  
  178. [44] Deletes the temporary variable Kickstart.
  179.  
  180. [46] Runs the IPrefs program, which sets the preferences in
  181. the Workbench (colours, fonts, background and so on)
  182.  
  183. [48] Starts the console clipboard manager program.
  184.  
  185. [50] This long line defines the various paths which AmigaDOS
  186. will use when looking for commands. When you open a Shell
  187. and enter a command, AmigaDOS will examine all these
  188. directories in this order until it finds the command.
  189.  
  190. [52] to [54] If there is a file called user-startup in the
  191. S: directory, exectute it. This means that instead of adding
  192. commands to s:startup-sequence, you can add them instead to
  193. the file called user-startup.
  194.  
  195. [56] Remove the resident command Execute from memory.
  196.  
  197. [57] Remove the resident command Assign.
  198.  
  199. [59] Load the Workbench!
  200.  
  201. [60] Shut down the (invisable) Shell which has been
  202. executing this start-up sequence.
  203.  
  204.  
  205.  
  206.  
  207.  
  208. Shell-Startup
  209.  
  210.  
  211. Everytime you open up a Shell window to enter some commands,
  212. this script is loaded and executed. The default script is
  213. pretty tame:
  214.  
  215.  
  216. ; $VER: Shell-Startup 40.1 (9.2.93)
  217.  
  218. Prompt "%N.%S> "
  219. Alias Clear "Echo *"*E[0;0H*E[J*" "
  220. Alias XCopy "Copy CLONE "
  221.  
  222.  
  223. You can see that it defines the prompt which each Shell will
  224. use, and creates two more commands called Clear and XCopy.
  225. Clear will clear the window using a sequence of control
  226. codes. XCopy is useful for copying entire disks or
  227. directories in one go. If you would like to include you own
  228. AmigaDOS commands, this is where you define them.
  229.  
  230.  
  231. Ed-startup
  232.  
  233.  
  234. As you may know, AmigaDOS comes with its own text editor
  235. called ED. ED is a lot smarter than many people realise. By
  236. editing this file, you can customise the menus which Ed
  237. uses. There isn't space to go into detail now, but take a
  238. look at the file and try creating your own designer ED
  239. program to impress your mates.
  240.  
  241.  
  242. PCD
  243.  
  244. This is another script, but one designed to be used as a
  245. command. It's based on the AmigaDOS command "CD" which is
  246. used to change the current directory. If you use the command
  247. in the same was as CD, you won't notice any differrence for
  248. example:
  249.  
  250. (ma2.iff)
  251.  
  252.  
  253. However, when you enter PCD by itself, it returns to the
  254. last location you moved to, like this:
  255.  
  256. (ma3.iff)
  257.  
  258.  
  259.  
  260. DPAT & SPAT
  261.  
  262.  
  263. These are two more scripts which can be treated like
  264. commands. They are used when you want to perform the same
  265. command on multiple files, and although there use is limited
  266. (not least because many commands already allow use on
  267. multiple files) they can occasionally be very useful.
  268.  
  269. SPAT is a "Single file PATtern" program. It allows you to
  270. include wildcards in commands. Wildcards are special symbols
  271. which can represent multiple files:
  272.  
  273.     #?             Means "all files"
  274.     #?.info     Means "all files ending in .info"
  275.     test.???    Means "all files starting in test. and
  276.                 ending with three letters, e.g. test.doc
  277.                 test.iff and test.bak"
  278.  
  279. Here's an example. Let's say you wanted to examine the
  280. version number of a library in the LIBS: drawer, you could
  281. do it like this:
  282.  
  283. (ma4.iff)
  284.  
  285. Now if you wanted to do it to all the file in the LIBS:
  286. drawer, you might try this. As you can see, it doesn't
  287. work.
  288.  
  289. (ma5.iff)
  290.  
  291. That's where SPAT comes in. Use it instead and you'll
  292. achieve the original aim.
  293.  
  294. (ma6.iff)
  295.  
  296.  
  297. DPAT works in a similar way except that it allows you to
  298. enter two filenames 
  299.  
  300.  
  301.